package com.zhl.hadoop.mapreduce.partition;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

/**
 * @program: demos
 * @description:
 * @author: 刘振华
 * @create: 2020-10-28 16:41
 **/
public class MyPartitioner extends Partitioner<Text, NullWritable> {

	@Override
	public int getPartition(Text text, NullWritable nullWritable, int i) {
		String grade = text.toString().split("\t")[1];
		return Integer.parseInt(grade)/60;
	}
}
